{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "df716f51",
   "metadata": {},
   "source": [
    "### 本周学习笔记\n",
    "#### 1.[gitub education packages](https://education.github.com)\n",
    "\n",
    "*注册学生账号，获得pycharm激活邮箱，为下周使用做准备\n",
    "\n",
    "#### 2.[pycharm下载官网](https://www.jetbrains.com/pycharm/)安装和jupyter notebook的安装学习\n",
    "\n",
    "*注意事项：安装专业版\n",
    "\n",
    "#### 2.主要学习了jupyter notebook的使用\n",
    " \n",
    "*[官网](https://jupyter.org/)\n",
    "*学习如何在自己电脑打开jupyter notebook (cmd中直接执行jupyter notebook 或实现直接跳转)\n",
    "*jupyter notebook 可以做代码的管理系统，学习到每周如何整理自己的学习内容\n",
    "\n",
    "#### 4.快速开展python项目一，奇数中选择指点时间minute"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "382eeeaf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Not an odd minute.\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime \n",
    "\n",
    "odds = [ 1,  3,  5,  7,  9, 11, 13, 15, 17, 19,\n",
    "        21, 23, 25, 27, 29, 31, 33, 35, 37, 39,\n",
    "        41, 43, 45, 47, 49, 51, 53, 55, 57, 59 ]\n",
    "\n",
    "right_this_minute = datetime.today().minute\n",
    "\n",
    "if right_this_minute in odds:\n",
    "    print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "    print(\"Not an odd minute.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "48fc704a",
   "metadata": {},
   "source": [
    "#### 5.[观察标准库](https://docs.python.org/zh-cn/3/library/index.html)：处理日期和时间，标准库提供了datetime模块处理这种类型的数据\n",
    "*date.today函数提供今天的日期，.day(日）；.month(月)；.year(年)\n",
    "*可以调用date.isoformat(datetime.date.today())函数并传入今天的日期\n",
    "*调用strftime函数并指出希望以什么方式显示时间小时（%H）;分钟（%M）\n",
    "*星期几，上午还是下午可以使用time.strftime(\"%A %p\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "b5ade72c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.date(2021, 9, 11)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import datetime\n",
    "datetime.date.today()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "8a3e4162",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "11"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today().day"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "e6da7067",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today().month"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "d31ee6f8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2021"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today().year"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "d80894a0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2021-09-11'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.isoformat(datetime.date.today())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "67251eee",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'16 52'"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import time\n",
    "time.strftime(\"%H %M\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "8c7643e1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Saturday PM'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.strftime(\"%A %p\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d604a223",
   "metadata": {},
   "source": [
    "#### 扩展这个代码：它会运行5次“检查分钟代码”（利用Python的\"for\"循环）。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "245f56d1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Not an odd minute\n",
      "This minute seems a little odd.\n",
      "This minute seems a little odd.\n",
      "Not an odd minute\n",
      "Not an odd minute\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "import random\n",
    "import time\n",
    "\n",
    "odds = [ 1,  3,  5,  7,  9, 11, 13, 15, 17, 19,\n",
    "        21, 23, 25, 27, 29, 31, 33, 35, 37, 39,\n",
    "        41, 43, 45, 47, 49, 51, 53, 55, 57, 59 ]\n",
    "\n",
    "for i in range(5):\n",
    "    right_this_minute = datetime.today() .minute\n",
    "    if right_this_minute in odds:\n",
    "        print(\"This minute seems a little odd.\")\n",
    "    else:\n",
    "        print(\"Not an odd minute\")\n",
    "    wait_time = random.randint(1, 60)\n",
    "    time.sleep(wait_time)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "beba29af",
   "metadata": {},
   "source": [
    "#### Head First经典“啤酒歌谣”的Python版本。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "7f017e51",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "99 botttles of beer on the wall.\n",
      "99 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "98 botttles of beer on the wall.\n",
      "98 botttles of beer on the wall.\n",
      "98 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "97 botttles of beer on the wall.\n",
      "97 botttles of beer on the wall.\n",
      "97 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "96 botttles of beer on the wall.\n",
      "96 botttles of beer on the wall.\n",
      "96 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "95 botttles of beer on the wall.\n",
      "95 botttles of beer on the wall.\n",
      "95 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "94 botttles of beer on the wall.\n",
      "94 botttles of beer on the wall.\n",
      "94 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "93 botttles of beer on the wall.\n",
      "93 botttles of beer on the wall.\n",
      "93 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "92 botttles of beer on the wall.\n",
      "92 botttles of beer on the wall.\n",
      "92 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "91 botttles of beer on the wall.\n",
      "91 botttles of beer on the wall.\n",
      "91 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "90 botttles of beer on the wall.\n",
      "90 botttles of beer on the wall.\n",
      "90 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "89 botttles of beer on the wall.\n",
      "89 botttles of beer on the wall.\n",
      "89 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "88 botttles of beer on the wall.\n",
      "88 botttles of beer on the wall.\n",
      "88 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "87 botttles of beer on the wall.\n",
      "87 botttles of beer on the wall.\n",
      "87 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "86 botttles of beer on the wall.\n",
      "86 botttles of beer on the wall.\n",
      "86 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "85 botttles of beer on the wall.\n",
      "85 botttles of beer on the wall.\n",
      "85 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "84 botttles of beer on the wall.\n",
      "84 botttles of beer on the wall.\n",
      "84 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "83 botttles of beer on the wall.\n",
      "83 botttles of beer on the wall.\n",
      "83 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "82 botttles of beer on the wall.\n",
      "82 botttles of beer on the wall.\n",
      "82 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "81 botttles of beer on the wall.\n",
      "81 botttles of beer on the wall.\n",
      "81 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "80 botttles of beer on the wall.\n",
      "80 botttles of beer on the wall.\n",
      "80 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "79 botttles of beer on the wall.\n",
      "79 botttles of beer on the wall.\n",
      "79 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "78 botttles of beer on the wall.\n",
      "78 botttles of beer on the wall.\n",
      "78 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "77 botttles of beer on the wall.\n",
      "77 botttles of beer on the wall.\n",
      "77 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "76 botttles of beer on the wall.\n",
      "76 botttles of beer on the wall.\n",
      "76 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "75 botttles of beer on the wall.\n",
      "75 botttles of beer on the wall.\n",
      "75 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "74 botttles of beer on the wall.\n",
      "74 botttles of beer on the wall.\n",
      "74 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "73 botttles of beer on the wall.\n",
      "73 botttles of beer on the wall.\n",
      "73 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "72 botttles of beer on the wall.\n",
      "72 botttles of beer on the wall.\n",
      "72 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "71 botttles of beer on the wall.\n",
      "71 botttles of beer on the wall.\n",
      "71 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "70 botttles of beer on the wall.\n",
      "70 botttles of beer on the wall.\n",
      "70 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "69 botttles of beer on the wall.\n",
      "69 botttles of beer on the wall.\n",
      "69 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "68 botttles of beer on the wall.\n",
      "68 botttles of beer on the wall.\n",
      "68 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "67 botttles of beer on the wall.\n",
      "67 botttles of beer on the wall.\n",
      "67 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "66 botttles of beer on the wall.\n",
      "66 botttles of beer on the wall.\n",
      "66 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "65 botttles of beer on the wall.\n",
      "65 botttles of beer on the wall.\n",
      "65 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "64 botttles of beer on the wall.\n",
      "64 botttles of beer on the wall.\n",
      "64 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "63 botttles of beer on the wall.\n",
      "63 botttles of beer on the wall.\n",
      "63 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "62 botttles of beer on the wall.\n",
      "62 botttles of beer on the wall.\n",
      "62 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "61 botttles of beer on the wall.\n",
      "61 botttles of beer on the wall.\n",
      "61 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "60 botttles of beer on the wall.\n",
      "60 botttles of beer on the wall.\n",
      "60 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "59 botttles of beer on the wall.\n",
      "59 botttles of beer on the wall.\n",
      "59 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "58 botttles of beer on the wall.\n",
      "58 botttles of beer on the wall.\n",
      "58 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "57 botttles of beer on the wall.\n",
      "57 botttles of beer on the wall.\n",
      "57 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "56 botttles of beer on the wall.\n",
      "56 botttles of beer on the wall.\n",
      "56 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "55 botttles of beer on the wall.\n",
      "55 botttles of beer on the wall.\n",
      "55 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "54 botttles of beer on the wall.\n",
      "54 botttles of beer on the wall.\n",
      "54 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "53 botttles of beer on the wall.\n",
      "53 botttles of beer on the wall.\n",
      "53 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "52 botttles of beer on the wall.\n",
      "52 botttles of beer on the wall.\n",
      "52 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "51 botttles of beer on the wall.\n",
      "51 botttles of beer on the wall.\n",
      "51 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "50 botttles of beer on the wall.\n",
      "50 botttles of beer on the wall.\n",
      "50 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "49 botttles of beer on the wall.\n",
      "49 botttles of beer on the wall.\n",
      "49 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "48 botttles of beer on the wall.\n",
      "48 botttles of beer on the wall.\n",
      "48 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "47 botttles of beer on the wall.\n",
      "47 botttles of beer on the wall.\n",
      "47 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "46 botttles of beer on the wall.\n",
      "46 botttles of beer on the wall.\n",
      "46 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "45 botttles of beer on the wall.\n",
      "45 botttles of beer on the wall.\n",
      "45 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "44 botttles of beer on the wall.\n",
      "44 botttles of beer on the wall.\n",
      "44 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "43 botttles of beer on the wall.\n",
      "43 botttles of beer on the wall.\n",
      "43 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "42 botttles of beer on the wall.\n",
      "42 botttles of beer on the wall.\n",
      "42 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "41 botttles of beer on the wall.\n",
      "41 botttles of beer on the wall.\n",
      "41 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "40 botttles of beer on the wall.\n",
      "40 botttles of beer on the wall.\n",
      "40 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "39 botttles of beer on the wall.\n",
      "39 botttles of beer on the wall.\n",
      "39 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "38 botttles of beer on the wall.\n",
      "38 botttles of beer on the wall.\n",
      "38 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "37 botttles of beer on the wall.\n",
      "37 botttles of beer on the wall.\n",
      "37 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "36 botttles of beer on the wall.\n",
      "36 botttles of beer on the wall.\n",
      "36 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "35 botttles of beer on the wall.\n",
      "35 botttles of beer on the wall.\n",
      "35 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "34 botttles of beer on the wall.\n",
      "34 botttles of beer on the wall.\n",
      "34 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "33 botttles of beer on the wall.\n",
      "33 botttles of beer on the wall.\n",
      "33 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "32 botttles of beer on the wall.\n",
      "32 botttles of beer on the wall.\n",
      "32 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "31 botttles of beer on the wall.\n",
      "31 botttles of beer on the wall.\n",
      "31 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "30 botttles of beer on the wall.\n",
      "30 botttles of beer on the wall.\n",
      "30 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "29 botttles of beer on the wall.\n",
      "29 botttles of beer on the wall.\n",
      "29 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "28 botttles of beer on the wall.\n",
      "28 botttles of beer on the wall.\n",
      "28 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "27 botttles of beer on the wall.\n",
      "27 botttles of beer on the wall.\n",
      "27 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "26 botttles of beer on the wall.\n",
      "26 botttles of beer on the wall.\n",
      "26 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "25 botttles of beer on the wall.\n",
      "25 botttles of beer on the wall.\n",
      "25 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "24 botttles of beer on the wall.\n",
      "24 botttles of beer on the wall.\n",
      "24 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "23 botttles of beer on the wall.\n",
      "23 botttles of beer on the wall.\n",
      "23 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "22 botttles of beer on the wall.\n",
      "22 botttles of beer on the wall.\n",
      "22 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "21 botttles of beer on the wall.\n",
      "21 botttles of beer on the wall.\n",
      "21 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "20 botttles of beer on the wall.\n",
      "20 botttles of beer on the wall.\n",
      "20 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "19 botttles of beer on the wall.\n",
      "19 botttles of beer on the wall.\n",
      "19 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "18 botttles of beer on the wall.\n",
      "18 botttles of beer on the wall.\n",
      "18 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "17 botttles of beer on the wall.\n",
      "17 botttles of beer on the wall.\n",
      "17 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "16 botttles of beer on the wall.\n",
      "16 botttles of beer on the wall.\n",
      "16 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "15 botttles of beer on the wall.\n",
      "15 botttles of beer on the wall.\n",
      "15 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "14 botttles of beer on the wall.\n",
      "14 botttles of beer on the wall.\n",
      "14 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "13 botttles of beer on the wall.\n",
      "13 botttles of beer on the wall.\n",
      "13 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "12 botttles of beer on the wall.\n",
      "12 botttles of beer on the wall.\n",
      "12 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "11 botttles of beer on the wall.\n",
      "11 botttles of beer on the wall.\n",
      "11 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "10 botttles of beer on the wall.\n",
      "10 botttles of beer on the wall.\n",
      "10 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "9 botttles of beer on the wall.\n",
      "9 botttles of beer on the wall.\n",
      "9 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "8 botttles of beer on the wall.\n",
      "8 botttles of beer on the wall.\n",
      "8 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "7 botttles of beer on the wall.\n",
      "7 botttles of beer on the wall.\n",
      "7 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "6 botttles of beer on the wall.\n",
      "6 botttles of beer on the wall.\n",
      "6 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "5 botttles of beer on the wall.\n",
      "5 botttles of beer on the wall.\n",
      "5 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "4 botttles of beer on the wall.\n",
      "4 botttles of beer on the wall.\n",
      "4 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "3 botttles of beer on the wall.\n",
      "3 botttles of beer on the wall.\n",
      "3 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "2 botttles of beer on the wall.\n",
      "2 botttles of beer on the wall.\n",
      "2 botttles of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "1 bottle of beer on the wall.\n",
      "1 bottle of beer on the wall.\n",
      "1 bottle of beer.\n",
      "Take one down.\n",
      "Pass it around.\n",
      "No more bottles of beer of beer on the wall.\n"
     ]
    }
   ],
   "source": [
    "word = \"botttles\"\n",
    "for beer_num in range(99, 0, -1):\n",
    "    print(beer_num, word, \"of beer on the wall.\")\n",
    "    print(beer_num, word, \"of beer.\")\n",
    "    print(\"Take one down.\")\n",
    "    print(\"Pass it around.\")\n",
    "    if beer_num == 1:\n",
    "        print(\"No more bottles of beer of beer on the wall.\")\n",
    "    else:\n",
    "        new_num = beer_num - 1\n",
    "        if new_num == 1:\n",
    "            word = \"bottle\"\n",
    "        print(new_num, word, \"of beer on the wall.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d538056d",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
